import React from 'react';

const Son = (props) => {
  // 在子组件中调用父组件中的函数并传递参数
  const sonMsg = '子组件数据'
  return (
    <div>
      {props.name}{props.child}
      {props.children}

      <button onClick={() => { props.onGwtSonMsg(sonMsg) }}>传递给父组件</button>
    </div>
  );
};

export default Son;